package com.ssc.common;

import com.ssc.model.User;

/**
 * 用户工具类
 *
 * @author wuxianji
 * @since 2017/10/31 10:00
 **/
public class UserUtils {

    private static ThreadLocal<User> threadLocal = new ThreadLocal<>();

    /**
     * 设置当前登录用户
     * @param user
     */
    public static void setCurrentUser(User user) {
        threadLocal.set(user);
    }

    /**
     * 获取当前登录用户
     * @return
     */
    public static User getCurrentUser() {
        return threadLocal.get();
    }
}
